<?php

declare(strict_types=1);

namespace app\search\controller;

use app\BaseController;
use app\model\Goods;

class Index extends BaseController
{
    /**
     * 商品搜索接口
     *
     * @return void
     */
    public function index()
    {
        $keyWord = $this->request->param('keyWord');
        $DBgoods = new Goods();
        $info = $DBgoods->where('goods_name|goods_desc', 'like', '%' . $keyWord . '%')->select();
        return result($info);
    }
}
